<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateActivitiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activities', function (Blueprint $table) {
            $table->id();
            $table->string('title')->index()->comment('标题');
            $table->string('banner')->comment('活动海报');
            $table->text('equity')->comment('权益规则');
            $table->text('describe')->comment('活动说明');
            $table->string('poster')->nullable()->comment('活动背景图');
            $table->integer('order')->unsigned()->default(0)->comment('排序');
            $table->string('qrcode')->nullable()->comment('二维码');
            $table->boolean('show')->default(TRUE)->comment('是否展示');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activities');
    }
}
